<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${title}">Insert title here</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <script th:src="@{/js/jquery-3.3.1.min.js}"></script>
    <script th:src="@{/js/popper.min.js}"></script>
    <script th:src="@{/js/bootstrap.min.js}"></script>
    <script th:src="@{/js/vue.min.js}"></script>
    <script th:src="@{/js/index.js}"></script>
</head>
<body>

<nav class="navbar navbar-expand-lg navbar-dark bg-danger">
    <a id="home" class="navbar-brand" th:href="@{'/'}" th:text="#{text.home}">home</a>
    <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item active">
                <a class="nav-link" th:href="@{'/user/admin'}" target="mainframe">admin</a>
            </li>
            <li class="nav-item active">
                <a class="nav-link" th:href="@{'/user/common'}" target="mainframe">common</a>
            </li>
        </ul>
        <ul class="navbar-nav navbar-right">
            <li class="dropdown">
                <button class="btn btn-danger dropdown-toggle" type="button"
                        id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                </button>
                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
                    <a class="dropdown-item" href="javascript:$('#logoutForm').submit();"
                       th:text="#{text.logout}">注销</a>
                    </div>
            </li>
        </ul>
    </div>
</nav>

<div class="embed-responsive embed-responsive-16by9">
<iframe name="mainframe" class="embed-responsive-item" th:src="@{'/user/admin'}"></iframe>
</div>
<form id="logoutForm" th:action="@{/logout}" method="post">
</form>
<footer>
<script type="text/javascript" th:inline="javascript">
    const context = /*[[@{'/'}]]*/ '';
    const environment = /*[[${environment}]]*/ {};
</script>
</footer>
</body>
</html>